<template>
  <section>
    <el-dialog title="撤件" :visible.sync="open" width="500px" append-to-body @close="cancel" custom-class="withdraw-mode">
       <Form
        :formData="formData"
        :formBtns="formBtns"
        @handleSubmit="handleSubmit"
      />

    </el-dialog>
  </section>
</template>

<script>
import Form from "@/components/form/index.vue";
import { vendorAuditOperatorAudit } from "@/api/collect/task/index";
export default {
  components: {
    Form,
  },
  props:{
    row: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      open: true,
      formData: [
        {
          prop: "reason",
          type: "textarea",
          rows: 3,
          label: "备注",
          placeholder: "请输入备注",
          value: "",
        },

      ],
      formBtns: [
        //表单按钮
        {
          type: "primary",
          label: "保存",
          isVerify: true,
        },
        {
          label: "返回",
          click: () => {
           this.$emit('onBack','isWithdraw');
          },
        },
      ],


    };
  },

  mounted() {


  },
  methods: {

    //保存
    handleSubmit(data) {
      let params = {
        id: this.row.id,
        status:0,
        ...data
      }
       vendorAuditOperatorAudit(params).then(response => {
        this.Message("撤回成功");
        this.$emit('onSuccess','isWithdraw');
      });
    },
    // 关闭模态框
    cancel() {
      this.$emit('onBack','isWithdraw');
    },
  },
};
</script>

<style lang="scss">
@import "../../../assets/styles/collect.scss";
.withdraw-mode{
  .el-dialog__body{
    padding: 30px 20px 15px;
  }
  .form{
    margin-bottom: 0;
    .el-form-item{
      width: 100%;
      .el-form-item__label{
        width: 60px!important;
      }
      .el-form-item__content{
        margin-left: 60px!important;
      }
        &:last-child{
         margin-bottom: 0!important;
       }
    }

  }
}
</style>
